package com.equipment.system.service.impl;

import com.equipment.system.mapper.EquipmentMapper;
import com.equipment.system.pojo.EchartData;
import com.equipment.system.service.EchartService;
import com.equipment.system.utils.LocalFormat;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashSet;
import java.util.Locale;
import java.util.Set;

/**
 * ${DESCRIPTION}
 *
 * @author 杨凯
 * @create 2018-03-30 9:51
 **/
@Service
public class EchartServiceImpl implements EchartService {

	@Autowired
	private EquipmentMapper equipmentMapper;

	@Override
	public Set<EchartData> getMapDataByProvince() {
		Set<EchartData> set = equipmentMapper.getMapDataByProvince();
		Set<EchartData> newSet = new HashSet<>();
		for (EchartData data : set) {
			String result = LocalFormat.removeEnd(data.getName());
			data.setName(result);
			newSet.add(data);
		}
		return newSet;
	}
}
